n = int(input())
s = input().split()
a = []
sum = [0 for i in range(0, 200)]
for i in range(0, n):
    a.append(int(s[i]))
a.sort()
ans = 0
for i in range(0, n -1):
    print(a[i], end = ' ')
print(a[n-1])
for i in range(1, n):
    sum[i] = sum[i - 1] + a[i - 1]
    ans = ans + sum[i]
print("%.2lf"%( ans / n))
